package trees.tree

class Leaf (override val id:Int)extends AbstractLeaf(id){


    def getLeafs():List[Int] = List[Int](id)

    override def toString() = {
        if ( this.id == IdFactory.getID("root"))
        //"root"
        ""
        else
        IdFactory.getLabel(id)
    }

    override def equals(b:Any):Boolean = b match{
        case l:Leaf => l.id==this.id
        case _ => false
    }

    override def deepCopy():AbstractLeaf = {
        new Leaf(id)
    }

    override def changeMutability():AbstractLeaf = deepCopy

    override def getMinId():Int=id
}
